﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WeChatV3Pay.Application.Refunds.Services;

namespace WeChatV3Pay.UnitTest.业务测试
{
    public class 退款测试
    {
        private readonly IRefundsService _refundsService;
        public 退款测试(IRefundsService refundsService)
        {
            _refundsService = refundsService;
        }

        [Fact]
        public async Task 退款申请测试()
        {
            var num = await _refundsService.RefundsAsync(new Application.Refunds.Dtos.RefundsReq()
            {
                Mchid = "1231",
                Reason = "测试退款",
                NotifyUrl = "https://yyyy.xxxx.com",
                OutTradeNo = "234234",
                OutRefundNo = Guid.NewGuid().ToString().Replace("-", ""),
                Amount = new Core.Dtos.RefundAmount()
                {
                    Currency = "CNY",
                    Total = 180 * 100,
                    Refund = 180 * 100,
                },
                PrivateKey = "123132",
                SerialNo = "23423424",
            });
            Assert.NotNull(num);
        }
    }
}
